package com.coffee.statistics.service.dao;

import com.coffee.statistics.api.query.StatisticsQuery;
import com.coffee.statistics.api.result.MonthStatisticsResult;
import com.coffee.statistics.api.result.TotalStatisticsResult;
import com.coffee.statistics.service.bean.Statistics;
import org.apache.ibatis.annotations.Param;

import java.util.List;

public interface StatisticsDao {
    public Statistics findById(Integer id);


    public Statistics findByIdForUpdate(Integer id);

    public List<Statistics> findByIds(@Param("idList") List<Integer> idList);

    public Integer count(@Param("param") StatisticsQuery param);

    public List<Statistics> page(@Param("param") StatisticsQuery param, @Param("offset") Integer offset, @Param("rows") Integer rows);

    public Statistics findFirst(@Param("param") StatisticsQuery param);

    public Integer insert(Statistics param);

    Integer insertBatch(List<Statistics> list);

    public void updateById(@Param("param") Statistics param);

    public Integer deleteById(Integer id);

    public Integer deleteByIds(List<Integer> idList);

    public Statistics findByDate(@Param("date") String date);

    public List<MonthStatisticsResult> getMonthStatisticsResult(@Param("year") String year);

    public TotalStatisticsResult getTotalStatisticsResult(@Param("year") String year);

}